from itertools import combinations,permutations

# 排列
test_data = {'1', '2', '3'}

print('排列有：')
for i,j in permutations(test_data, 2):
    print(i,j)

# 组合
print('组合有：')
for i,j in combinations(test_data, 2):
    print(i,j)